#ifndef NULLPTR_H
#define NULLPTR_H

#if !(defined(nullptr_t) || (__cplusplus > 199711L) || defined(__GXX_EXPERIMENTAL_CXX0X__))

// taken from http://en.wikibooks.org/wiki/More_C++_Idioms/nullptr#Solution_and_Sample_Code
#include <typeinfo>

const // It is a const object...
class nullptr_t
{
  public:
    template<class T>
    inline operator T*() const // convertible to any type of null non-member pointer...
    { return 0; }

    template<class C, class T>
    inline operator T C::*() const   // or any type of null member pointer...
    { return 0; }

  private:
    void operator&() const;  // Can't take address of nullptr

} nullptr = {};

#endif
#endif // NULLPTR_H
